home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / Tools / MotifApp / ch10 / WordCountWindow.h < prev   
Encoding:
C/C++ Source or Header  |  1995-05-03  |  2.0 KB  |  64 lines

  1. ///////////////////////////////////////////////////////////////////////////////
  2. //////////////////////////////////////////////////////////////////////////////
  3. //         This example code is from the book:
  4. //
  5. //           Object-Oriented Programming with C++ and OSF/Motif
  6. //         by
  7. //           Douglas Young
  8. //           Prentice Hall, 1992
  9. //           ISBN 0-13-630252-1    
  10. //
  11. //         Copyright 1991 by Prentice Hall
  12. //         All Rights Reserved
  13. //
  14. //  Permission to use, copy, modify, and distribute this software for 
  15. //  any purpose except publication and without fee is hereby granted, provided 
  16. //  that the above copyright notice appear in all copies of the software.
  17. ///////////////////////////////////////////////////////////////////////////////
  18. //////////////////////////////////////////////////////////////////////////////
  19.  
  20.  
  21. /////////////////////////////////////////////////////////////
  22. // WordCountWindow.h: Count the frequency of each word
  23. //                    in a text file, as a test of the
  24. //                    InterruptibleCmd class
  25. /////////////////////////////////////////////////////////////
  26. #ifndef WORDCOUNTWINDOW_H
  27. #define WORDCOUNTWINDOW_H
  28. #include "MenuWindow.h"
  29.  
  30. class InterruptibleCmd;
  31. class CountWordsCmd;
  32.  
  33. class WordCountWindow : public MenuWindow {
  34.     
  35.   private:
  36.     
  37.     Widget _list;         // List of words found in file
  38.     Cursor _busyCursor;   // Displayed when application is busy
  39.     Cursor _normalCursor; // Cursor used when not busy
  40.     
  41.     // Functions for interfacing with the word count Cmd
  42.     
  43.     static void countWordsCallback ( void *, char * );
  44.     static void taskFinishedCallback ( InterruptibleCmd *, 
  45.                       Boolean, void * );
  46.     void taskFinished ( CountWordsCmd * );
  47.     void countWords ( char * );
  48.     
  49.     // Utility functions for manipulating cursors
  50.     
  51.     void setBusyCursor();
  52.     void setNormalCursor();
  53.     
  54.   protected:
  55.     
  56.     virtual void createMenuPanes();
  57.     virtual Widget createWorkArea ( Widget );
  58.     
  59.   public:
  60.     
  61.     WordCountWindow ( char * );
  62. };
  63. #endif
  64.